package com.webserver.http;

import java.util.HashMap;
import java.util.Map;

/**
 * 用于定义所有HTTP协议规定之内容，可被复用。
 */
public class HttpContext {
    public static final char CR = 13;
    public static final char LF = 10;
    private static Map<String,String> map = new HashMap<>();
    static{contentType();}
    private static void contentType(){
        map.put("html","text/html");
        map.put("text","text/css");
        map.put("application","application/javascript");
        map.put("png","image/png");
        map.put("gif","image/gif");
        map.put("jpg","image/jpeg");
    }
    public static String getContentType(String type){
        return map.get(type);
    }
}
